﻿using BodaNetCommunications.Cores;

namespace BodaNetCommunications.McComs
{
    /// <summary>
    ///  大小端的转换
    /// </summary>
    public class McByteTransformBase : ByteTransformBase
    {
        public McByteTransformBase()
        {
            EndianType = Utilities.ComTypes.EndianType.DCBA;
        }


        public override Type AnalysyseAddres<T>(string address, T value)
        {
            return typeof(T);
        }

        public override bool AnalysyseAddresType(ref string address, out Type addressType)
        {
            addressType = typeof(short);
            string str = address.Substring(0, 1);
            if (str.ToUpperInvariant() == "D")
            {
                addressType = typeof(short);

                return true;
            }

            return false;
        }

    }
}
